<div class="page">
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li>
					<a class="add"
						href="page/navigation/navigation_add.html?parent_id={parent_id}"
						target="dialog" width="380" height="240" callback="reload"><span>添加</span> </a>
				</li>
				<li>
					<a class="delete" url="/page/navigation/{category_id}"
						area="tbody.list" callback="reload" type="delete"
						target="navTabTodo" title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span>
					</a>
				</li>
			</ul>
		</div>

		<table class="list" width="98%" layoutH="54">
			<thead>
				<tr>
					<th width="25">
						<input type="checkbox" name="objectId" value="category_id" />
					</th>
					<th width="30">
						id
					</th>
					<th width="300">
						导航标题
					</th>
					<th width="60">
						子导航数
					</th>
					<th>
						描述
					</th>
					<th width="60">
						操作
					</th>
				</tr>
			</thead>
			<tbody style="display: none;" class="templet">
				<tr navigation="${category_id}" put="/page/navigation/${category_id}">
					<td>
						<input type="checkbox" name="category_id" value="${category_id}" />
					</td>
					<td>
						${category_id}
					</td>
					<td name="name" title="${name}" class="edit" field="name">
						${name}
					</td>
					<td name="children_count" title="${children_count}">
						${children_count}
					</td>
					<td name="description" title="${description}" class="edit" field="description">
						${description}
					</td>
					<td>
						<a class="edit"
							href="page/navigation/navigation_update.html?category_id=${category_id}"
							target="dialog" warn="非法参数（${category_id}）" width="750"
							height="600" callback="updateNavigation" title="修改页面【${name}】"><span>修改</span>
						</a>
						<a class="edit" name="show" warn="非法参数（${category_id}）"
							target="ajax"
							url="page/navigation/navigation_children.html?parent_id=${category_id}"
							rel="navigation_demo_${category_id}"
							callback="$this.next('a[name=hide]').show();$this.hide();$this.removeAttr('href');"><span>详细</span>
						</a>
						<a class="edit" name="hide"
							style="display: none;"
							onclick="$(this).parents('tr[navigation=${category_id}]').next('tr[parentEntity=${category_id}]').hide();$(this).prev('a[name=show]').show();$(this).hide();"><span>收起</span>
						</a>
					</td>
				</tr>
				<tr parentEntity="${category_id}" class="hide">
					<td colspan="6" align="right" id="navigation_demo_${category_id}" class="shade" style="padding-bottom: 3px;">

					</td>
				</tr>
			</tbody>
			<tbody class="list" action="/page/navigation/{parent_id}/children">

			</tbody>
		</table>

		<div class="panelBar">
			<div class="pages"></div>
			<div class="pagination" totalCount="0" numPerPage="20" pageNumShown="10" currentPage="1"></div>
		</div>

	</div>
</div>
<script>
function updateNavigation(item){
	var table=$("table.list");
	var navigation=$("tr[navigation="+item.category_id+"]",table);
	navigation.find("td[name=name]").text(item.name);
	navigation.find("td[name=description]").text(item.description);
	alertMsg.correct("更新成功");
}
</script>
